package prepare.huawei;

import java.util.Scanner;

/**
 * description: <a href="https://blog.csdn.net/cui_song_lin/article/details/128874264">路灯照明问题</a>
 *
 * @author <a href="zhaoyingling12@163.com">simon zhao</a>
 * @since 2023/3/25
 */
public class StreetLighting {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = Integer.parseInt(input.nextLine());
        String[] ss = input.nextLine().split(" ");
        int[] areas = new int[n];
        for (int i = 0; i < ss.length; i++) {
            areas[i] = Integer.parseInt(ss[i]);
        }
        // action：需要考虑一些灯能照很远的情况
        // dp[i][0] 到第i个路灯这里，能向右照射多远，包括它自己的灯光和从其他灯照射过来的
        // dp[i][1] 到第i个路灯这里，能向左照射多远，包括它自己的灯光和从其他灯照射过来的
        int[][] dp = new int[n][2];
        int lastRight = 0;
        for (int i = 0; i < areas.length; i++) {
            int maxArea = Math.max(areas[i], lastRight - 100);
            dp[i][0] = maxArea;
            lastRight = maxArea;
        }

        int lastLeft = 0;
        for (int j = areas.length - 1; j >= 0; j--) {
            int maxArea = Math.max(areas[j], lastLeft - 100);
            dp[j][1] = maxArea;
            lastLeft = maxArea;
        }

        int sum = 0;
        for (int k = 0; k < areas.length - 1; k++) {
            int len = 100 - dp[k][0] - dp[k + 1][1];
            if (len > 0) {
                sum += len;
            }
        }
        System.out.println(sum);
    }
}
